package com.itheima.pattern.iterator;

public class Client {
    public static void main(String[] args) {
        StudentAggregate sa = new StudnetAggregateImpl();

        Student student = new Student("柳淇","12345676543");
        Student student1 = new Student("小蓝", "12345654345");
        Student tom = new Student("tom", "6543456543234");

        sa.addStudnet(student);
        sa.addStudnet(student1);
        sa.addStudnet(tom);

        StudentIterator iterator = sa.getStudentIterator();

        while (iterator.hasNext()){
            Student next = iterator.next();
            System.out.println(next);
        }


    }
}
